// 通知、公告
class News {

    String title
    String content 
    String category 
    Teacher editor
    Date createTime = new Date()   
    Integer hit = 0 //
 
 
    static mapping = {
       table 'xedu_news'
  
       sort  createTime : 'desc'
    }

    static constraints = {
        title(size:1..250,blank:false)
        category(size:1..250,blank:false)
        content(size:0..10000,blank:false)
     
        editor(nullable: true)
        hit(blank:true)  
    }

    String toString() {
        "${title}"
    }
}
